package com.yuyou.train.user.vo.req;

import java.util.List;

import com.yuyou.train.util.bean.ResBoolSimpleInfo;

public class ReqBehaviorExam {
	
	/**
	 * 是否重复做
	 */
	private boolean repeatExam;
	
	/**
	 * 耗时
	 */
	private Integer examTime;
	
	/**
	 * 我的答案
	 */
	private List<ReqBehaviorQuestion> myAns;

	public static ResBoolSimpleInfo<String> validate(ReqBehaviorExam req){
		ResBoolSimpleInfo<String> res=new ResBoolSimpleInfo<String>();
		if(req==null){
			res.setSuccess(false);
			res.setMessage("exam不能为空");
			return res;
		}
		else if(!req.isRepeatExam() &&req.getExamTime()==null){
			res.setSuccess(false);
			res.setMessage("耗时不能为空");
			return res;
		}
		else if(!req.isRepeatExam() && req.getMyAns()==null){
			res.setSuccess(false);
			res.setMessage("答案不能为空");
			return res;
		}
		
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	
	
	public Integer getExamTime() {
		return examTime;
	}

	public void setExamTime(Integer examTime) {
		this.examTime = examTime;
	}

	public List<ReqBehaviorQuestion> getMyAns() {
		return myAns;
	}

	public void setMyAns(List<ReqBehaviorQuestion> myAns) {
		this.myAns = myAns;
	}

	public boolean isRepeatExam() {
		return repeatExam;
	}

	public void setRepeatExam(boolean repeatExam) {
		this.repeatExam = repeatExam;
	}
	
	
	
	
}
